import 'package:json_annotation/json_annotation.dart';

part 'lesson.g.dart';

@JsonSerializable()
class PreLesson {
  List<Info> info;
  String pageIndex;
  String pageSize;
  String total;
  String createTime;

  PreLesson(
      {this.info, this.pageIndex, this.pageSize, this.total, this.createTime});

  PreLesson.fromJson(Map<String, dynamic> json) {
    if (json['info'] != null) {
      info = new List<Info>();
      json['info'].forEach((v) {
        info.add(new Info.fromJson(v));
      });
    }
    pageIndex = json['pageIndex'];
    pageSize = json['pageSize'];
    total = json['total'];
    createTime = json['createTime'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.info != null) {
      data['info'] = this.info.map((v) => v.toJson()).toList();
    }
    data['pageIndex'] = this.pageIndex;
    data['pageSize'] = this.pageSize;
    data['total'] = this.total;
    data['createTime'] = this.createTime;
    return data;
  }
}

class Info {
  String preLessonId;
  String title;
  bool hasTW;
  bool hasAudio;
  bool hasVideo;
  bool hasXZY;
  String mobilePublish;
  String isPublish;
  String releaseName;
  String releaseTime;

  Info(
      {this.preLessonId,
      this.title,
      this.hasTW,
      this.hasAudio,
      this.hasVideo,
      this.hasXZY,
      this.mobilePublish,
      this.isPublish,
      this.releaseName,
      this.releaseTime});

  Info.fromJson(Map<String, dynamic> json) {
    preLessonId = json['preLessonId'];
    title = json['title'];
    hasTW = json['hasTW'];
    hasAudio = json['hasAudio'];
    hasVideo = json['hasVideo'];
    hasXZY = json['hasXZY'];
    mobilePublish = json['mobilePublish'];
    isPublish = json['isPublish'];
    releaseName = json['releaseName'];
    releaseTime = json['releaseTime'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['preLessonId'] = this.preLessonId;
    data['title'] = this.title;
    data['hasTW'] = this.hasTW;
    data['hasAudio'] = this.hasAudio;
    data['hasVideo'] = this.hasVideo;
    data['hasXZY'] = this.hasXZY;
    data['mobilePublish'] = this.mobilePublish;
    data['isPublish'] = this.isPublish;
    data['releaseName'] = this.releaseName;
    data['releaseTime'] = this.releaseTime;
    return data;
  }
}
